package com.snail.service.serviceImp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.snail.mapper.BizOrderDetailMapper;
import com.snail.model.pojo.mall.BizOrderDetail;
import com.snail.service.BizOrderDetailService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BizOrderDetailServiceImpl
        extends ServiceImpl<BizOrderDetailMapper, BizOrderDetail>
        implements BizOrderDetailService {

    @Override
    public List<BizOrderDetail> getDetailsByOrderNo(String orderNo) {
        return lambdaQuery()
                .eq(BizOrderDetail::getOrderNo, orderNo)
                .list();
    }

    @Override
    public boolean batchInsertDetails(List<BizOrderDetail> details) {
        return saveBatch(details);
    }
}